import { Entity, PrimaryGeneratedColumn, Column, Unique } from 'typeorm';

@Entity()
@Unique(['deviceAddress'])
export class Device {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ comment: '设备类型' })
  deviceType: string;

  @Column({ comment: '设备地址' })
  deviceAddress: string;

  @Column({ comment: '硬件版本号', nullable: true })
  hardwareVersion: string;

  @Column({ comment: '软件版本号', nullable: true })
  softwareVersion: string;

  @Column({ comment: '最后一次上报时间', nullable: true })
  lastReportTime: string;

  @Column({ comment: '备注', nullable: true })
  remark: string;
}
